import Request from '../js_sdk/luch-request/luch-request/index.js'
const http = new Request() 

http.config.baseURL = 'https://25fbqgai.lc-cn-n1-shared.com/1.1/'
http.config.header = {
	'X-LC-Id':'25FBqGAiHXrTHrFeiiFnm2DL-gzGzoHsz',
	'X-LC-Key':'5VeLoQNridlOGrlmIAbbEDBF',
	'content-type':'application/json',
}

http.interceptors.request.use((config) => { // 可使用async await 做异步操作
  return config
}, config => { // 可使用async await 做异步操作
  return Promise.reject(config)
})

http.interceptors.response.use((response) => { /* 对响应成功做点什么 可使用async await 做异步操作*/
  console.log('响应拦截器',response)
  return response
}, (response) => { /*  对响应错误做点什么 （statusCode !== 200）*/
  console.log(response)
  return Promise.reject(response)
})

export default http